package com.pojo;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import lombok.Data;
import java.time.LocalDateTime;

@Data
public class Users {

  private Integer id;

  @NotBlank(message = "用户名不能为空")
  @Size(min = 3, max = 50, message = "用户名长度必须在3-50个字符之间")
  private String username;

  @NotBlank(message = "密码不能为空")
  @Size(min = 8, max = 100, message = "密码长度必须在8-100个字符之间")
  private String password;

  @NotBlank(message = "昵称不能为空")
  @Size(min = 2, max = 50, message = "昵称长度必须在2-50个字符之间")
  private String nickname;

  @Size(max = 255, message = "头像URL长度不能超过255个字符")
  private String avatarUrl;

  @Size(max = 500, message = "个人简介长度不能超过500个字符")
  private String bio;

  @NotBlank(message = "邮箱不能为空")
  @Email(message = "邮箱格式不正确")
  private String email;

  private LocalDateTime createdAt;
  private LocalDateTime updatedAt;
}